#!/bin/bash

# 定义局部变量
local_var="I am local"
echo "Parent shell (local_var): $local_var"

# 定义环境变量
export env_var="I am exported"
echo "Parent shell (env_var): $env_var"

# 子进程测试
bash -c 'echo "Child shell (local_var): $local_var; env_var: $env_var"'

